<template>
  <div class="banner">
    <i class="icon-fresh" @click="reFresh" v-if="isFresh"></i>
    <i class="icon-code" @click="ride" v-if="isRide"></i>
    <i class="icon-close" @click="banner=false" v-if="banner&&bannerConfig.showBanner&&isBanner"></i>
    <a :href="bannerConfig.bannerHerf" v-if="banner&&bannerConfig.showBanner&&isBanner"
       id="banner" onclick="_hmt.push(['_trackEvent','banner', 'click', 'dianji'])">
      <img :src="bannerConfig.bannerUrl" class="ad-img">
    </a>
  </div>
</template>
<script>
  import {jsLink} from '../../utils/public.js'

  export default {
    data() {
      return {
        banner: true
      }
    },
    props: ['isFresh', 'isRide', 'isBanner'],
    computed: {
      bannerConfig() {
        return global.lineConfig.banner
      }
    },
    methods: {
      reFresh() {
        window.location.reload()
      },
      ride() {
        jsLink('href', this.bannerConfig.ride)
      }
    }
  }
</script>
<style>
  @import './index.css';
</style>
